﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kardex_Entity;

namespace Kardex_DataAccess
{
    class PersonDA
    {
        bd_kardexEntities context;
        public PersonDA()
        {
            context = new bd_kardexEntities();            
        }

        public person Save( person newPerson)
        {
            try
            {
                context.person.AddObject(newPerson);
                context.SaveChanges();
                return newPerson;
            }
            catch (Exception ex)
            {                
                throw new Exception(ex.Message.ToString());
            }
        }

    }
}
